import QtQuick
import QtQuick.Controls
import Qt5Compat.GraphicalEffects

Item {

    Flow {

        anchors.fill: parent
        spacing: 10
        padding: 10

        Rectangle {
            width: 280
            height: 280
            color: "white"

            Image {
                id: butterfly
                source: "qrc:/images/butterfly.png"
                sourceSize: Qt.size(parent.width, parent.height)
                smooth: true
                visible: false
            }

            GammaAdjust {
                id: gammaAdjust
                anchors.fill: butterfly
                source: butterfly
                gamma: 0.45
            }

            Grid {
                rows: 3
                columns: 2
                topPadding: 15
                anchors.bottom: parent.bottom
                anchors.horizontalCenter: parent.horizontalCenter

                Text { text: "gamma:" }
                Slider {
                    from: 0
                    to: 3
                    stepSize: 0.01
                    value: 0.45

                    onValueChanged: {
                        console.log("gamma: " + value)
                        gammaAdjust.gamma = value
                    }
                }
            }
        }

    }
}
